package com.toutou.base.util

import android.content.Context
import android.view.View
import android.view.inputmethod.InputMethodManager

/**
 * 隐藏软键盘
 */
fun hideSoftKeyboard(activity: Context?, view: View?) {
    val imm = activity?.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
    imm.hideSoftInputFromWindow(view?.windowToken, 0) //强制隐藏键盘
    view?.clearFocus()
}